<?php


namespace App\Models\CacheModel;


use App\Models\Api\BaseCache;

class ForbidenRecord extends BaseCache
{
    protected $table = 'wechat_backup_07_18_14_43_00.app_forbid_record';

    /**
     * 添加封号记录
     * @param int $uid
     * @param int $aid
     * @param string $reason
     * @return bool
     */
    public function saveData(int $uid, int $aid, string $reason)
    {
        $insertData = [
            'uid' => $uid,
            'aid' => $aid,
            'create_time' => time(),
            'reason' => $reason,
            'type' => 1
        ];
        try
        {
            $this->insertGetId($insertData);
        }
        catch (\Exception $e)
        {
            return false;
        }
        return true;
    }
}
